package cn.topcodes.tcsf.admin.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import cn.topcodes.tcsf.admin.domain.entity.SysUserRoleRela;

import java.util.List;

public interface SysUserRoleRelaMapper extends Mapper<SysUserRoleRela> {

    @Select("select r.code from t_sys_role r join t_sys_user_role_rela rela on r.id=rela.role_id " +
            "join t_sys_user u on rela.user_id=u.id where u.id=#{userId}")
    List<String> getRoleCodesByUserId(@Param("userId") Long userId);
}